﻿using Autofac;
using GC_FFW.ForecastWriter.Abstractions.Interfaces.Builders;
using GC_FFW.ForecastWriter.Abstractions.Interfaces.Factories;
using GC_FFW.ForecastWriter.Abstractions.Interfaces.Helpers;
using GC_FFW.ForecastWriter.Builders;
using GC_FFW.ForecastWriter.Factories;
using GC_FFW.ForecastWriter.Helpers;

namespace GC_FFW.ForecastWriter.Modules.Autofac
{
	public class ForecastWriterModule : Module
	{
		#region Override Methods

		protected override void Load(ContainerBuilder builder)
		{
			base.Load(builder);

			builder.RegisterType<Randomizer>().As<IRandomizer>().SingleInstance();

			builder.RegisterType<StringManager>().As<IStringManager>().SingleInstance();

			//Dependencies: IXmlSerializerService, IStringManager, IRandomizer, IApplicationConfiguration
			builder.RegisterType<ProposalAdapterFactory>().As<IProposalAdapterFactory>().SingleInstance();

			//Dependencies: IProposalAdapterFactory
			builder.RegisterType<ForecastBuilder>().As<IForecastBuilder>().SingleInstance();

			builder.RegisterType<ForecastStructureBuilder>().As<IForecastStructureBuilder>().SingleInstance();
		}

		#endregion
	}
}
